<?php

namespace app\common\model\mysql;

use think\Model;

class SOrderConfigure extends Model
{
    public function getOrderConfigure($merId,$field = '*'){
        $where = [
            ['mer_id','=',$merId],
        ];
        $result = $this->where($where)->field($field)->find();
        return $result ? $result->toArray() : [];
    }

    /**
     * 根据主键id更新数据表中的数据
     * @param $id
     * @param $data
     * @return bool
     */
    public function updateById($id,$data){
        $id = intval($id);
        if(empty($id) || empty($data) || !is_array($data)){
            return false;
        }
        $where = [
            "order_configure_id"=>$id,
        ];
        return $this->where($where)->save($data);
    }
}
